<template>
    <div>
       这是啥
    </div>
</template>
<script setup lang="ts">
import {useSiteConfig} from '~/stores/siteConfig'
import {isMobile} from '~/utils/common'
import {useI18n} from 'vue-i18n'

import { chatgptStream,demo2 } from '~/api/user/chatai'
const {t} = useI18n()
useSeoMeta({
    title: t('user.login.Login'),
})
const sendLoading=ref(false)
const siteConfig = useSiteConfig()

const chatList=reactive([])
const isMobileDevice = ref(isMobile())
const sendQuestion=()=>{
    const eventSource = new EventSource('http://localhost:8000/index.php/api/chatai/chatgptStream');
    eventSource.onmessage = (event) => {
        const data = JSON.parse(event.data);
        console.log(data,'返回信息')
        chatList.push({'title':"张三",'content':'提出的问题'+data.message})
        //this.messages.push(data.message);
    };

    eventSource.onerror = (error) => {
        console.error('EventSource failed:', error);
        eventSource.close();
    };
    // chatgptStream({
    //     type:'',
    //     accountVerificationToken: '',
    // })
    //     .then((res) => {
    //         console.log(res,'fanhui ')
    //     })
    //     .finally(() => {
    //
    //     })
}
import Typewriter from '~/components/Typewriter.vue';
</script>
<style scoped>
@import url('~/assets/newsite/chataipc.css');
</style>
<style lang="scss" scoped>
.msg {
    color: rgb(88, 88, 88);
    letter-spacing: 2px;
}

.msg  :deep(.cursorChar) {
    display: inline-block;
    margin-left: 2px;
}
@media screen and (max-width: 750px) {
    * {
        margin: 0;
        padding: 0;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }
    body {
        font-size: 0.24rem;
        max-width: 750px;
        min-width: 320px;
        margin: 0 auto;
        padding: 0;
        background: #f7f8fa;
        color: #000;
    }

}
</style>
